From 45e603f6f86785c232a8b7d49a723660a7d0124b Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Wed, 30 May 2012 08:57:51 +0100 Subject: [PATCH] libxl: Introduce libxl__arch_domain_create (x86 version) Signed-off-by: Stefano Stabellini Acked-by: Ian Jackson Acked-by: Ian Campbell Committed-by: Ian Campbell --- tools/libxl/Makefile | 2 +- tools/libxl/libxl_create.c | 12 ++---------- tools/libxl/libxl_x86.c | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 tools/libxl/libxl_x86.c diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index a11ac519d9..cf59c67829 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -34,7 +34,7 @@ LIBXL_OBJS-y += libxl_blktap2.o else LIBXL_OBJS-y += libxl_noblktap2.o endif -LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_noarch.o +LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_x86.o LIBXL_OBJS-$(CONFIG_IA64) += libxl_nocpuid.o libxl_noarch.o LIBXL_OBJS-$(CONFIG_ARM) += libxl_nocpuid.o libxl_noarch.o diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 77acecca9a..4456ae8012 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -18,6 +18,7 @@ #include "libxl_osdeps.h" /* must come before any other headers */ #include "libxl_internal.h" +#include "libxl_arch.h" #include #include @@ -835,16 +836,7 @@ static void domcreate_devmodel_started(libxl__egc *egc, } } - if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV && - libxl_defbool_val(d_config->b_info.u.pv.e820_host)) { - ret = libxl__e820_alloc(gc, domid, d_config); - if (ret) { - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, - "Failed while collecting E820 with: %d (errno:%d)\n", - ret, errno); - goto error_out; - } - } + libxl__arch_domain_create(gc, d_config, domid); domcreate_console_available(egc, dcs); domcreate_complete(egc, dcs, 0); diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c new file mode 100644 index 0000000000..7e28504020 --- /dev/null +++ b/tools/libxl/libxl_x86.c @@ -0,0 +1,19 @@ +#include "libxl_internal.h" +#include "libxl_arch.h" + +int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config, + uint32_t domid) +{ + int ret = 0; + if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV && + libxl_defbool_val(d_config->b_info.u.pv.e820_host)) { + ret = libxl__e820_alloc(gc, domid, d_config); + if (ret) { + LIBXL__LOG_ERRNO(gc->owner, LIBXL__LOG_ERROR, + "Failed while collecting E820 with: %d (errno:%d)\n", + ret, errno); + } + } + + return ret; +} -- 2.30.2